alter proc [dbo].[APP_GET_EMPLOYEE_SPA_STATUS]    
 @ACC_ID int    
    
as    
select top 5 dbo.SPA.SPA_NAME, dbo.SERVICES.SER_NAME,dbo.CLIENTS.CLI_NAME,(dbo.EMPLOYEES.EMP_FIRSTNAME +' '+ dbo.EMPLOYEES.EMP_LASTNAME)    
AS FULLNAME,dbo.APPOINTMENTS.APP_DATE,dbo.APPOINTMENTS.APP_STARTTIME,dbo.APPOINTMENTS.APP_STATUS,dbo.APPOINTMENTS.APP_ID     
from dbo.APPOINTMENTS,dbo.CLIENTS,dbo.EMPLOYEES,dbo.SERVICES,dbo.SPA     
    
where dbo.SERVICES.SER_ID=dbo.APPOINTMENTS.SER_ID AND dbo.APPOINTMENTS.SPA_ID = dbo.SPA.SPA_ID    
AND dbo.APPOINTMENTS.CLI_ID = dbo.CLIENTS.CLI_ID AND dbo.EMPLOYEES.EMP_ID=dbo.APPOINTMENTS.EMP_ID and dbo.APPOINTMENTS.APP_STATUS='WAIT'    
and dbo.CLIENTS.ACC_ID=@ACC_ID
order by dbo.APPOINTMENTS.APP_ID desc 